import request from '@/utils/request'
import qs from 'qs';

// 查询敏感规则列表
export function listRule(query) {
  return request({
    url: '/apisecurity/sensitiveRule/list',
    method: 'get',
    params: query
  })
}

// 查询敏感规则详细
export function getRule(id) {
  return request({
    url: '/apisecurity/sensitiveRule/query?id=' + id,
    method: 'get'
  })
}

// 新增敏感规则
export function addRule(data) {
  return request({
    url: '/apisecurity/sensitiveRule/add',
    method: 'post',
    data: data
  })
}

// 编辑敏感规则
export function updateRule(data) {
  return request({
    url: '/apisecurity/sensitiveRule/update',
    method: 'post',
    data: data
  })
}

// 删除敏感规则
export function delRule(data) {
  return request({
    url: '/apisecurity/sensitiveRule/delete',
    method: 'post',
    data
  })
}

// 匹配敏感规则
export function matchRule(data) {
  return request({
    url: '/apisecurity/sensitiveRule/getMatching',
    method: 'post',
    data: data
  })
}


// 替换敏感规则
export function replaceRule(data) {
  return request({
    url: '/apisecurity/sensitiveRule/getValidating',
    method: 'post',
    data: data
  })
}

// 分组规则
export function classRule(data) {
  return request({
    url: '/apisecurity/sensitiveRule/getGrouping',
    method: 'post',
    data: data
  })
}


// 启用停用敏感规则
export function updateRuleStatus(data) {
  return request({
    url: '/apisecurity/sensitiveRule/updateStatus',
    method: 'post',
    data: data
  })
}
